<style>
.lookupRepairOrder span.error{
    position:absolute     !important;

    left:257px;
}
</style>
<div class="pageContent">
    <form method="post" id="requestRepairForm"
        action="${rc.getContextPath()}/manage/equipmentRepair/saveRequestRepair"
        class="pageForm required-validate"
        onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent" >
            <input type="hidden" name="navTabId" value="${navTabId!''}">
            <input type="hidden" name="id"
                value="<#if (repairOrder.orderCode)??>${repairOrder.orderCode!''}</#if>" />
            <input type="hidden" name="pattern"
                value="${pattern!''}" />
            <input type="hidden" name="processdefinitionKey" value="repairEquipment">
            <fieldset>
                <dl>
                    <dt><@label key='repairOrderCode.C,colon'>报修单号：</@label></dt>
                    <dd style="nowrap"><input type="text" name="orderCode"  size="22" type="text" maxlength="20" value="${repairOrder.orderCode!''}" readonly="readonly" 
                                      <#if pattern!="add">
                                      readonly="readonly"
                                     </#if>
                                />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key='repairStatusECode.C,colon'>处理状态：</@label></dt>
                    <dd><input type="text" name="statusECode"  size="22"  maxlength="20"  readonly="readonly"
                            <#if ECode??><#list ECode as eCode>
                                <#if  repairOrder.statusECode==eCode.eCode>
                                    value="${eCode.eCodeText!''}"
                                </#if>
                            </#list></#if>
                                />
                    </dd>
                </dl>
                <dl class="lookupRepairOrder">
                    <dt><@label key="equipmentCode.C,colon">设备编号：</@label></dt>
                    <dd>
                      <input class="required look" id="equipmentLookup.equipmentCode" name="equipmentCode" type="text" postField="equipmentCode" suggestFields="equipmentCode,equipmentText" 
                    suggestUrl="${rc.getContextPath()}/manage/equipment/equipmentSuggest" lookupGroup="equipmentLookup" value="${repairOrder.equipmentCode!''}"
                    warn="<@label key='equipmentCode.C,doesNotExist.C'>设备编号不存在</@label>"  remote="${rc.getContextPath()}/manage/equipment/validateEquipmentCodeForSelect"/>
                    <a class="btnLook" href="${rc.getContextPath()}/manage/equipment/equipmentLookUp" rel="equipmentLookup_dialog" width="700" height="450" lookupGroup="equipmentLookup" title="<@label key='queryEquipment.D'>设备选择</@label>"></a>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key='equipmentText.C,colon'>设备描述：</@label></dt>
                    <dd><input id="equipmentLookup.equipmentText" readonly size="22" type="text" maxlength="60" name="equipmentText" value="${repairOrder.equipmentText!''}" />
                    </dd>
                </dl>
               
                <dl  class="lookupRepairOrder">
                    <dt><@label key="failureCode.C,colon">故障代码：</@label></dt>
                    <dd>
                        <input class="required look" id="failureLookup.failureCode" name="failureCode" type="text" postField="failureCode" suggestFields="failureCode,failureText" 
                    suggestUrl="${rc.getContextPath()}/manage/failure/failureSuggest" lookupGroup="failureLookup" value="${repairOrder.failureCode!''}"
                    warn="<@label key='failureCode.C,doesNotExist.C'>故障代码不存在</@label>"  remote="${rc.getContextPath()}/manage/failure/checkFailureCode"/>
                    <a class="btnLook" href="${rc.getContextPath()}/manage/failure/failureLookup" rel="failureLookup_dialog" width="700" height="450" lookupGroup="failureLookup" title="<@label key='queryFailureCode.D'>故障代码选择</@label>"></a>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="failureText.C,colon">故障描述：</@label></dt>
                    <dd>
                        <input id="failureLookup.failureText" readonly size="22" type="text" maxlength="60" name="failureText" value="${repairOrder.failureText!''}" />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key='requestUser.C,colon'>报修人：</@label></dt>
                    <dd style="nowrap"><input type="text" name="requestUser"  size="22" type="text" maxlength="20" class="required" readonly="readonly""
                                      value="${repairOrder.requestUser!''}" 
                                />
                    </dd>
                </dl>
                 <dl>
                    <dt><@label key='department.C,colon'>部门：</@label></dt>
                    <dd><input id="equipmentLookup.useDepartment" readonly size="22" type="text" maxlength="60" name="department" value="${repairOrder.department!''}" />
                    </dd>
                </dl>
                 <dl>
                    <dt><@label key='shutdownStartDatetime.C,colon'>停线开始时间：</@label></dt>
                    <dd><input type="text" class="date"   readonly="readonly" size="17"   dateFmt='yyyy-MM-dd HH:mm' name="shutdownStartDatetime" value="${(repairOrder.shutdownStartDatetime?string('yyyy-MM-dd HH:mm'))?if_exists}" />
                        <a class="inputDateButton" href="javascript:;">选择</a>
                    </dd>
                </dl>
                
            </fieldset>
        </div>
        <#if pattern!="add" && repairOrder??>
            <#assign createInfo=repairOrder>
            <#include "/common/createInfo.html">
        </#if>
        <div class="formBar">
            <ul>
                <#if pattern!="read">
                    <#if "audit"==pattern>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">接单</button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonActiveGrey">
                            <div class="buttonContent">
                                    <button type="button" class="close">驳回</button>
                            </div>
                        </div>
                    </li>
                       <#else>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit"><@label key="save.B">保存</@label></button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="button"  onclick="startTask();"><@label key="requestRepair.B">报修</@label></button>
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="buttonActiveGrey">
                            <div class="buttonContent">
                                    <button type="button" class="close"><@label key="cancel.B">取消</@label></button>
                            </div>
                        </div>
                    </li>
                    </#if>
                <#else>
                    <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                                <button type="button" class="close"><@label key="close.B">关闭</@label></button>
                        </div>
                    </div>
                </li>
                </#if>
            </ul>
        </div>
    </form>
</div>

<script>

function startTask(){
    alertMsg.confirm("<@label key='confirmstartTask.M'>确定启动流程?</@label>", {
        okCall: function(){
            var form=$("#requestRepairForm",$.pdialog.getCurrent());
            form.attr("action","${rc.getContextPath()}/manage/equipmentRepair/startTask?operation=insert");
            form.attr("onsubmit","return validateCallback(this, startFlowAjaxDone);");
            form.submit();
        }
    });

}

</script>
